package com.niodata.dp.monitor.components.task.monitor;

import com.niodata.dp.monitor.core.task.TaskExecutionManager;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

@DisallowConcurrentExecution
@PersistJobDataAfterExecution
public class HistoryFetchJob implements Job {

  @Autowired
  @Qualifier("taskManagerImpl")
  TaskExecutionManager taskManager;

  @Override
  public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
    taskManager.syncExecutionList();
  }

}
